<div>
    <hr>
    <h4><b>评论</b></h4>
    <form action="{% url 'article:post_comment' article.id %}" method="post">
        {% csrf_token %}
        <textarea class="form-control" rows="3" name="content"></textarea>
        <br>
        <button type="submit" class="btn btn-primary">提交</button>
    </form>
    <hr>

    <div class="panel panel-danger">
        <div class="panel-body">评论列表</div>

        <div id="first">

        {% for comment_ in comments %}
            {% for comment in comment_ %}
                {% if comment.parent is not None %}
                    <span style="display:block;text-indent:2em;"> {{ comment.content }}</span>
                    <span style="display:block;text-indent:2em;">{{ comment.post_time }} user：{{ comment.author.username }} to {{ comment.parent.author.username }}</span>
                    <hr>
                {% else %}
                    <span> {{ comment.content }}</span>
                    <span>{{ comment.post_time }} user：{{ comment.author.username }}</span>
                    <hr>
                {% endif %}
            {% endfor %}
        {% endfor %}
        </div>
    </div>

</div>

<style>
    #first {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
</style>